﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
   xmlns:huddled="http://schemas.huddledmasses.org/wpf"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">
	<ControlTemplate x:Key="ClearCaptionButton" TargetType="{x:Type ButtonBase}">
		<ControlTemplate.Resources>
			<Storyboard x:Key="MouseEnter">
				<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="00:00:00.0010000">
					<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
				</DoubleAnimationUsingKeyFrames>
				<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="border1" Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.GlowColor)">
					<SplineColorKeyFrame KeyTime="00:00:00" Value="#FF0077EE"/>
				</ColorAnimationUsingKeyFrames>
				<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="border1" Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)">
					<SplineDoubleKeyFrame KeyTime="00:00:00" Value="12"/>
				</DoubleAnimationUsingKeyFrames>
				<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="glow" Storyboard.TargetProperty="(Border.BorderThickness)">
					<SplineThicknessKeyFrame KeyTime="00:00:00" Value="0,0,0,2"/>
				</ThicknessAnimationUsingKeyFrames>
				<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="glow" Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
					<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
				</DoubleAnimationUsingKeyFrames>
				<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="glow" Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
					<SplineColorKeyFrame KeyTime="00:00:00" Value="#6200E9FF"/>
				</ColorAnimationUsingKeyFrames>
				<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.BitmapEffect).(BlurBitmapEffect.KernelType)">
					<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static KernelType.Gaussian}"/>
				</ObjectAnimationUsingKeyFrames>
				<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.BitmapEffect).(BlurBitmapEffect.Radius)">
					<SplineDoubleKeyFrame KeyTime="00:00:00" Value="3"/>
				</DoubleAnimationUsingKeyFrames>
				<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="border1" Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.Opacity)">
					<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.8"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
			<Storyboard x:Key="MouseExit">
				<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="00:00:00.0010000">
					<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				</DoubleAnimationUsingKeyFrames>
				<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="border1" Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.Opacity)">
					<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
		</ControlTemplate.Resources>
		<Border BorderBrush="#FF000000" BorderThickness="0" CornerRadius="0"
              MaxHeight="{DynamicResource {x:Static SystemParameters.WindowCaptionButtonHeightKey}}"
			     x:Name="border1" Style="{DynamicResource Clickable}"
              >
			<Border.BitmapEffect>
				<OuterGlowBitmapEffect GlowSize="1" Opacity="0"/>
			</Border.BitmapEffect>
			<Border BorderBrush="#4CFFFFFF" x:Name="border" BorderThickness="0" CornerRadius="0">
				<Grid>
					<Grid.RowDefinitions>
						<RowDefinition Height="0.507*"/>
						<RowDefinition Height="0.493*"/>
					</Grid.RowDefinitions>
					<Border Opacity="0" HorizontalAlignment="Stretch" x:Name="glow" Width="Auto" Grid.RowSpan="2" CornerRadius="0,0,0,0" BorderThickness="0,0,0,1" SnapsToDevicePixels="True">
						<Border.BitmapEffect>
							<OuterGlowBitmapEffect GlowColor="#FF00BAFF"/>
						</Border.BitmapEffect>
						<Border.BorderBrush>
							<LinearGradientBrush EndPoint="1,1" StartPoint=".5,1" SpreadMethod="Reflect">
								<GradientStop Color="#1000F5FF" Offset="1"/>
								<GradientStop Color="#FF00BAFF" Offset="0.018"/>
							</LinearGradientBrush>
						</Border.BorderBrush>
					</Border>
					<!--<Border x:Name="shine" HorizontalAlignment="Stretch" Margin="0,0,0,0" Width="Auto" CornerRadius="0,0,0,0" BorderBrush="#D1FFFFFF" BorderThickness="0,1,0,0">
                  <Border.Background>
                     <LinearGradientBrush EndPoint="0.494,0.889" StartPoint="0.494,0.028">
                        <GradientStop Color="#9AFFFFFF" Offset="0"/>
                        <GradientStop Color="#41FFFFFF" Offset="1"/>
                     </LinearGradientBrush>
                  </Border.Background>
               </Border>-->
					<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Grid.RowSpan="2"/>
				</Grid>
			</Border>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="IsPressed" Value="True">
				<Setter TargetName="glow"   Property="Visibility" Value="Hidden"/>
			</Trigger>
			<Trigger Property="IsMouseOver" Value="True">
				<Trigger.EnterActions>
					<BeginStoryboard Storyboard="{StaticResource MouseEnter}"/>
				</Trigger.EnterActions>
				<Trigger.ExitActions>
					<BeginStoryboard Storyboard="{StaticResource MouseExit}"/>
				</Trigger.ExitActions>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
</ResourceDictionary>